package org.example.commons.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.converters.string.StringImageConverter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;
import java.io.Serializable;

/**
 * 管理员账号表(SysAdmin)实体类
 *
 * @author bothin
 * @since 2020-05-23 18:02:24
 */
@Entity
@Data
@DynamicUpdate
@ColumnWidth(25)
public class SysAdmin implements Serializable {
    private static final long serialVersionUID = 410837374678876414L;
    /**
    * 管理员id
    */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ExcelProperty("管理员编号")
    private Long adminId;
    /**
    * 微信openid
    */
    @ExcelProperty("微信openid")
    private String openid;
    /**
    * 头像
    */
//    @ExcelProperty(value = "头像", converter = StringImageConverter.class)
    @ExcelProperty(value = "头像")
    private String avatarUrl;
    /**
    * 姓名
    */
    @ExcelProperty("名字")
    private String name;
    /**
    * 手机号
    */
    @ExcelProperty("手机号")
    private String phone;
    /**
    * 密码
    */
    @JsonIgnore
    @ExcelIgnore
    private String password;
    /**
     * 帐号状态（0停用 1正常）
     */
    @ExcelProperty("账号状态（0停用 1正常）")
    private Integer status;
    /**
    * 创建时间
    */
    @ExcelProperty("创建时间")
    private Date createTime;
    /**
    * 修改时间
    */
    @ExcelProperty("修改时间")
    private Date updateTime;

}